#!/usr/bin/perl
#walk through each element of a hash

# DEFINE A HASH
%coins = ( "Quarter" , 25,
           "Dime" ,    10,
           "Nickel",    5 );
           
# LOOP THROUGH IT
while ( my ($key, $value) = each(%coins)){
     print $key.", ".$value."\n";
}

# Loop through keys
foreach my $key (keys %coins)
{
	print "$key", "\n";
}

# Loop through values
foreach my $value (values %coins)
{
	print "$value", "\n";
}